In my case the cause was the name of the app target.
It was just App. Renaming it fixed the issue so it's apparently some name collisions.
The symptom itself was interesting: the app was crashing when .zIndex(1) modifier was used. I guess it might be not only one modifier that can cause this though.